package com.ymatou.query.trading.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.query.trading.api.parameter.GetPackageDeliveryOrdersCountBean;
import com.ymatou.query.trading.api.service.GetPackageDeliveryOrdersCountCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.YMTDateUtil;
/**
*查询国内段未发货的拼邮订单接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetPackageDeliveryOrdersCount{
	private static GetPackageDeliveryOrdersCountBean getpackagedeliveryorderscountBean;
	private static GetPackageDeliveryOrdersCountCall getpackagedeliveryorderscountCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("查询国内段未发货的拼邮订单接口");
	}

	@Before
	public void caseUp() {
		getpackagedeliveryorderscountBean=new GetPackageDeliveryOrdersCountBean();
		getpackagedeliveryorderscountCall=new GetPackageDeliveryOrdersCountCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getpackagedeliveryorderscountCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetPackageDeliveryOrdersCount_001() {
		Logger.start(true,"查询国内段未发货的拼邮订单成功");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			getpackagedeliveryorderscountBean.setSellerId(SellerId);
			getpackagedeliveryorderscountBean.setDomesticDelivered(false);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-2);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(2);
			getpackagedeliveryorderscountBean.setTimeFrom(BeginTime);
			getpackagedeliveryorderscountBean.setTimeTo(EndTime);
			getpackagedeliveryorderscountCall.setData(getpackagedeliveryorderscountBean);
			getpackagedeliveryorderscountCall.callService();			
			Logger.comment("getpackagedeliveryorderscountCall send:" + getpackagedeliveryorderscountCall.getEntityString());
			Logger.comment("getpackagedeliveryorderscountCall response:" + getpackagedeliveryorderscountCall.getReturnData());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}